package dao

import (
	"context"

	"catering_sys_api/cmd/api/model"
	"catering_sys_api/core/db"
)

type BusinessDao struct {
	ctx context.Context
}

func NewBusinessDao(ctx context.Context) *BusinessDao {
	return &BusinessDao{ctx: ctx}
}

func (p *BusinessDao) GetBusinessByBusinessId(businessId int) (business model.Business, err error) {
	err = db.DB.Model(model.Business{}).Where(" id = ? ", businessId).First(&business).Error
	return
}
